package com.woniuxy02;

import java.util.Scanner;

public class Test09 {
    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        String answer = "";
//        do {
//            System.out.println("玩一把游戏");
//            System.out.println("是否开始游戏y/n");
//            answer = scanner.next();
//        } while (answer.equals("y"));

//        System.out.println("程序结束");


//        Scanner scanner = new Scanner(System.in);
//        String answer = "y";
//        while (answer.equals("y")){
//            System.out.println("玩一把游戏");
//            System.out.println("是否开始游戏y/n");
//            answer = scanner.next();
//        }
//
//        System.out.println("程序结束");


        Scanner scanner = new Scanner(System.in);
        String answer = "y";
        for(;answer.equals("y");answer = scanner.next()){
            System.out.println("玩一把游戏");
            System.out.println("是否开始游戏y/n");
        }
        System.out.println("程序结束");
    }
}
